package com.example.petadopt.dao;

import com.example.petadopt.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;

public interface UserDao extends JpaRepository<User,Integer> {
    User queryByAccountAndPwd(String account,String pwd);

    // 检查用户名是否已存在
    boolean existsByName(String name);
    boolean existsByAccount(String account);

    // 保存新用户
    User save(User user);

    User queryById(int userId);

    User findById(int userId);
}
